#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>

int main()
{
    /*
    write(1,"write",6);
    printf("printf");
    fprintf(stdout,"fprintf");
    fwrite("fwrite",1,7,stdout);
    sleep(3);
    */
    
    close(1);
    int fd = open("./test.txt",O_RDWR);
    if(fd < 0){
        perror("open error");
        return -1;
    }
    printf("fd:%d\n",fd);
    fflush(stdout);
    close(fd);
    
    return 0;
}
